/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLJAVA_ATTRIBUTE_STACK_MAP_FULL_FRAME_H
#define PLJAVA_ATTRIBUTE_STACK_MAP_FULL_FRAME_H

#include <PLJavaFile.h>
#include <filetypes/PLJavaAttributeStackMap.h>

namespace PLSDK {

/**
 * Class to hald stack map information Full Frame in the stack map table.
 */
class PLJavaAttributeStackMapFullFrame : public PLJavaAttributeStackMap {
public:
    /**
     * Constructor.
     *
     * @param offset The offset delta.
     * @param numberOfLocals The length of the locals array.
     * @param info The locals info to set.
     * @param numberOfStacks The length of the stack array.
     * @param stacks The stack info to set.
     */
    PLJavaAttributeStackMapFullFrame(u2 offset, u2 numberOfLocals, PLJavaAttributeStackMapVerificationTypeInfo **locals, u2 numberOfStacks, PLJavaAttributeStackMapVerificationTypeInfo **stacks);
    /**
     * Get the offset delta.
     *
     * @return The offset.
     */
    inline u2 offset();
    /**
     * The length of the locals array.
     *
     * @return The length of the array.
     */
    inline u2 numberOfLocals();
    /**
     * Get the type from the Locals.
     *
     * @param index The index of the locals type to get.
     * @return The Verification Type Info.
     */
    PLJavaAttributeStackMapVerificationTypeInfo *locals(u2 index);
    /**
     * The length of the stacks array.
     *
     * @return The length of the array.
     */
    inline u2 numberOfStacks();
    /**
     * Get the type from the stacks.
     *
     * @param index The index of the stacks type to get.
     * @return The Verification Type Info.
     */
    PLJavaAttributeStackMapVerificationTypeInfo *stacks(u2 index);
private:
    u2 m_offset;
    u2 m_numberOfLocals;
    PLJavaAttributeStackMapVerificationTypeInfo **m_locals;
    u2 m_numberOfStacks;
    PLJavaAttributeStackMapVerificationTypeInfo **m_stacks;
};

u2 PLJavaAttributeStackMapFullFrame::numberOfLocals() {
    return m_numberOfLocals;
}

u2 PLJavaAttributeStackMapFullFrame::offset() {
    return m_offset;
}

u2 PLJavaAttributeStackMapFullFrame::numberOfStacks() {
    return m_numberOfStacks;
}

}

#endif
